package com.ling.brushes.view
{
	import com.ling.brushes.BrushControl;
	import com.ling.map.BgGridStyle;
	import com.ling.ui.BrushBtnUI;
	import com.tommy.ddp.definition.GridSkinFactory;
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	
	import flashx.textLayout.formats.TextDecoration;
	
	import mx.events.FlexEvent;
	
	import spark.components.BorderContainer;
	import spark.filters.GlowFilter;
	
	public class BaseGridBrush extends BrushBtnUI
	{
		
		public function BaseGridBrush()
		{
			super();
			addEventListener(FlexEvent.INITIALIZE,onInit);
		}
		
		private function onInit(event:FlexEvent):void
		{
			img.source = icon;
			label.text = brushName;
		}
		
		protected function get icon():BitmapData
		{
			return BgGridStyle.getBmd(GridSkinFactory.NORMAL);
		}
		
		protected function get brushName():String
		{
			return "";
		}
		
		public function set selected(b:Boolean):void
		{
			if(b)
			{
				//this.filters = [new GlowFilter(0,1,3,3,10)];
				label.setStyle("color",0xDD0000);
				label.setStyle("fontWeight","bold");
				label.setStyle("fontSize",14);
				label.setStyle("textDecoration",TextDecoration.UNDERLINE);
			}
			else
			{
				label.setStyle("color",0);
				label.setStyle("fontWeight","normal");
				label.setStyle("fontSize",12);
				label.setStyle("textDecoration",TextDecoration.NONE);
			}
		}
		
		
		public function get type():uint
		{
			return GridSkinFactory.NORMAL;
		}
	}
}